#include <stdio.h>

int main () 
{
	char ch;
	int A = 0, a = 0, num = 0, other = 0; 
	while ( (ch=getchar()) != '\n' ) {
		if ( ch >= 'A' && ch <= 'Z' ) {
			A ++;
		} else if ( ch >= 'a' && ch <= 'z' ) {
			a ++;
		} else if ( ch >= '0' && ch <= '9' ) {
			num ++;
		} else {
			other ++;
		}
	} 
	printf("%d %d %d %d",A,a,num,other);
	return 0;
}